// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-6-4

#ifndef __AES_H_NETMSG__
#define __AES_H_NETMSG__

#pragma once

#include <windows.h>

//##ModelId=44CF17B1032E
class CJoyAes
{
protected:
	//##ModelId=44CF17B10361
    class SContext
    {
    public:
		//##ModelId=44CF17B10362
	    INT key_length;
		//##ModelId=44CF17B1036B
	    DWORD E[60];
		//##ModelId=44CF17B1036C
	    DWORD D[60];
    };
	//##ModelId=44CF17B1033D
    SContext    m_Context;
public:
	//##ModelId=44CF17B10341
    CJoyAes(void* pKey = NULL, UINT nSize = 0);
	//##ModelId=44CF17B10344
    virtual ~CJoyAes(){}

	//##ModelId=44CF17B10346
    virtual const UINT* GetLegalKeySizes();
	//##ModelId=44CF17B1034C
    virtual UINT GetBlockSize();
	//##ModelId=44CF17B1034E
    virtual UINT GetKeySize();
	//##ModelId=44CF17B10350
    virtual bool SetKey(void* pKey, UINT nSize);
    
	//##ModelId=44CF17B10354
    virtual bool Encrypt(PVOID pOut, LPCVOID pIn, size_t nSize);
	//##ModelId=44CF17B1035C
    virtual bool Decrypt(PVOID pOut, LPCVOID pIn, size_t nSize);
};

#endif  // __AES_H_NETMSG__
